<style>
body{overflow-x:auto;margin-bottom:60px;}
</style>
<div class="Singleform">
<div class="tabs">
<div class="alert alert-info">
  上传数据xml或者xls文件，批量导入数据。
</div>
{{$this->Html->script(array('jquery/jquery.form.js'))}}
<?PHP
	echo $this->MForm->create($current_model,array('type'=>'file','data-noajax'=>true));
?>
        <fieldset>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="StyleVariables">数据文件</label>
			<div class="col-sm-10 controls text">
				<input type="file" id="StyleVariables" style="height:32px;" name="importfile">
			</div>
		</div>
    <div class="form-group">
    	<label class="col-sm-2 control-label"></label>
    	<div class="col-sm-10 controls"><?php echo $this->MForm->submit(__('Import'),array('id'=>'btnsubmit')); ?></div>
    </div>
    </fieldset>
	{{$this->MForm->end()}}
</div>

<hr/>
<div class="alert alert-warning">
	<p>如果指定了编号，则导入时会自动修改原有数据。如果不修改原有数据请不要设置编号. </p>
	<p>可以选填某些列的值，不必所有列都设置。</p>
	<p>导入完成后，注意数据的发布与在线状态，可能由于不是发布状态不会显示在前台网页上。注意核查已导入数据的正确性。</p>
</div>
</div>
</div>

<h2>表格样例模板</h2>
<p><br/></p>
<table class="table table-striped table-hover">
<thead>
<tr>
	{{loop $extschema $key $field}}
	<?PHP  if( in_array($key,array('created','updated','remoteurl','view_nums','seotitle','seodescription','seokeywords')) ) continue;?>
	<th>{{$key}}</th>
	{{/loop}}
</tr>
</thead>
<tr>
	{{loop $extschema $key $field}}
	<?PHP  if( in_array($key,array('created','updated','remoteurl','view_nums','seotitle','seodescription','seokeywords')) ) continue;?>
	<th>{{$field['translate']}}</th>
	{{/loop}}
</tr>
</table>
<p><br/></p>
<div class="container">
<h2>xml样例模板</h2>
<pre>
<?php
	$value_item = array();
	foreach($extschema as $key => $field){
		if( in_array($key,array('created','updated','remoteurl','view_nums','seotitle','seodescription','seokeywords')) ) continue;
		$value_item[$key] = $field['translate'];
	}
	
	$xml =  str_replace('><',">\n<",array_to_xml(array('items'=> array('item' => $value_item))));
echo htmlspecialchars($xml);
?>
</pre>
</div>
